package models;

import java.util.*;

public enum Status {
	
	Available,
	Assigned,
	OSRest,
	OSMechPers;
	
	public static Collection<Status> GetAll()
	{
		ArrayList<Status> all = new ArrayList<Status>();
		for(Status value : Status.class.getEnumConstants())
			all.add(value);
		
		return all;		
	}
	
	public static Status toStatus(String val) {
		if (val == null) {
			return null;
		}
		if (val.equals("Available")) {
			return Available;
		}
		if (val.equals("Assigned")) {
			return Assigned;
		}
		if (val.equals("O/S Rest")) {
			return OSRest;
		}
		if (val.equals("O/S Mech/Pers")) {
			return OSMechPers;
		}
		return null;
	}

	public String toDisplayString() {
		switch(this)
		{ 
		case Available:
			return "Available";	
		case Assigned:
			return "Assigned";
		case OSRest:
			return "O/S Rest";
		case OSMechPers:
			return "O/S Mech/Pers";
		default:
			return super.toString(); 
		}
	}
}
